package com.adderis.soft.service.impl;

import java.util.List;

import javax.persistence.Query;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.adderis.soft.domain.dao.IUsersDao;
import com.adderis.soft.domain.model.Users;
import com.adderis.soft.service.IUsersBo;

@Service("usersService")
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public class UsersBoImpl implements IUsersBo {

	@Autowired
	private IUsersDao usersDao;

	@Transactional(readOnly = false)
	public void persist(Users transientUsers) {
		usersDao.persist(transientUsers);

	}

	@Transactional(readOnly = false)
	public void remove(Users persistentUsers) {
		usersDao.remove(persistentUsers);

	}

	@Transactional(readOnly = false)
	public Users merge(Users detachedUsers) {

		return usersDao.merge(detachedUsers);
	}
	
	@Transactional(readOnly = false)
	public void remove(Integer id) {
		usersDao.remove(id);

	}

	public Users findById(Integer id) {
		return usersDao.findById(id);
	}

	public List<Users> findAll() {
		return usersDao.findAll();
	}

	public List<Users> search(String searchString) {
		return usersDao.search(searchString);
	}


	public Users login(String login, String password) {
		return usersDao.login(login, password);
	}

	


	

}
